package single;

import feign.Feign;
import feign.Param;
import feign.RequestLine;
import feign.jackson.JacksonDecoder;

import java.util.List;

  interface GitHub {
  @RequestLine("GET /repos/{owner}/{repo}/contributors")
  List<Contributor> contributors(@Param("owner") String owner, @Param("repo") String repo);

  @RequestLine("GET /repos/{owner}/{repo}/contributors")
  List<Contributor> contributorTest(@Param("owner") String owner, @Param("repo") String repo);

      static class Contributor {
     String login;
     int contributions;
 }
}

public class FeignMyApp {
    public static void main(String... args) {
        String s ="https://mseapps.eallerp.com:8090/common/viewPhone";


        System.out.println("s.ssd"+s.substring(s.indexOf("/")));
        int start=s.indexOf("//")+2;
        int end = s.indexOf("/",start);
        System.out.println("a:"+start+",b:"+end+",result:"+s.substring(0,end));


        GitHub github = Feign.builder()
                .decoder(new JacksonDecoder())
                .target(GitHub.class, "https://api.github.com");

        // Fetch and print a list of the contributors to this library.
        List<GitHub.Contributor> contributors = github.contributors("OpenFeign", "feign");
        for (GitHub.Contributor contributor : contributors) {
            System.out.println(contributor.login + " (" + contributor.contributions + ")");
        }
    }
}